<template>
  <div id="app">
    <!--导航栏-->
    <div class="header_content" style=""><Header></Header></div>
    <!--   主体部分 -->
    <div class="body_content">
      <!--咨询主体 -->
      <div class="new_body">
        <!-- 咨询标题 -->
        <div class="title">{{News.newHead}}</div>
        <!-- /咨询标题 -->
        <!-- 公司名称 -->
        <div class="publisher">
          <img src="../assets/fabu.png" />
          {{News.name}}
        </div>
        <!-- /公司名称 -->
        <!-- 咨询时间 -->
        <div class="news_time">{{News.newsTime}}</div>
        <div class="news_line" />
        <!-- /咨询时间 -->
        <!-- 咨询内容 -->
        <div class="news_text">{{News.newsBody}}</div>
        <!-- /咨询内容 -->
      </div>
      <!--/咨询主体 -->
    </div>

    <!--footer -->
    <!--脚页-->
    <div><Footer></Footer></div>
  </div>
</template>

<script>
import Header from '../components/Header';
import Footer from '../components/Footer';
export default {
  name: 'Search',
  components: {
    Header,
    Footer
  },
  data() {
    return {
      News:{},
    }
  },

  methods: {
    /*通过单个id查询资讯*/
    findUserById(id) {
      this.updateFormVisible = true;
      let _this = this;
      this.$axios
        .get('http://localhost:8087/news/selectNewsById/' + id)
        .then(function(res) {
          _this.News = res.data[0];
          console.log(res.data[0].name);
        })
        .catch(function(err) {
          alert('查询失败');
        });
    },
  },
  created() {
      this.findUserById(this.$route.params.id);
  }
};
</script>

<style scoped>
.header_content {
  width: 100%;
  height: 74px;
  background-color: #121633;
  box-shadow: 1px 1px 10px #eaeaea;
  /*position: fixed;*/
}
.body_content {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}
.new_body {  
  overflow-x:hidden;
  height: 95%;
  box-shadow: 5px 5px 13px #9d9fa6;
}
.title {
  width: 100%;
  height: 50px;
  font-weight: 700;
  text-align: left;
  font-size: 30px;
  margin-top: 20px;
  margin-left: 8%;
}
.publisher {
  width: 100%;
  height: 50px;
  margin-top: 20px;
  margin-left: 8%;
  color: #2972fa;
  cursor: pointer;
}
.news_time{
  width: 100%;
  height: 50px;
  margin-top: 1px;
  margin-left: 8%;
  color: #999;
  cursor: pointer;
}
.news_line{
  margin:0 auto;
  width: 90%;
  height: 1px;
  background-color: #d1d1d1;
}
.news_text{
  margin:0 auto;
  width: 90%;
  line-height:52px;
  text-indent:35px;
}
</style>
